using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace BLL
{
public class ClsKF_PublicFun
{
///
/// ¸ù¾Ýµ¥¾ÝÀàÐÍ·µ»Øµ¥¾ÝÄÚÂëºÍµ¥¾ÝºÅ£¬²¢ÅжÏÊÇ·ñÒѾ´æÔÚÖØ¸´µÄÊý¾Ý
///
///
///
///
///
///
public bool get_MaxBillNoAndID(string HTranType, ref string HBillNo, ref Int64 HInterID, ref string sErrMsg)
{
HInterID = DBUtility.ClsPub.CreateBillID_Prod(HTranType, ref sErrMsg);
HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HTranType, ref sErrMsg, true);
//ÔÏÈ»ñÈ¡·½·¨
//HInterID = DBUtility.ClsPub.CreateBillID(HTranType, ref sErrMsg);
//HBillNo = DBUtility.ClsPub.CreateBillCode(HTranType, ref sErrMsg, true);
//ÅжÏÊÇ·ñ´æÔÚÏàͬµ¥¾ÝÄÚÂë»òµ¥¾ÝºÅ
try
{
DataSet ds;
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS " + HInterID + ",'" + HBillNo + "'", "h_p_IF_CheckBillIDExists_WMS");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
sErrMsg = "´æÔÚÖØ¸´µ¥¾ÝÄÚÂë»òµ¥¾ÝºÅµÄµ¥¾Ý£¬²»ÔÊÐíÐÂÔö£¬ÇëÍ˳öºóÖØÐµÇ¼£¡";
return false;
}
else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) == "1")
{
sErrMsg = "´æÔÚÖØ¸´µ¥¾ÝÄÚÂë»òµ¥¾ÝºÅµÄµ¥¾Ý£¬²»ÔÊÐíÐÂÔö£¬ÇëÍ˳öºóÖØÐµÇ¼£¡";
return false;
}
else
{
return true;
}
}
catch (Exception e)
{
sErrMsg = "ÖØ¸´µ¥¾ÝÄÚÂëÅжÏʧ°Ü£¡" + e.Message;
return false;
}
}
///
/// ÅжÏÓû§ÊÇ·ñÓÐȨÏÞ£¬²¢¸ù¾Ýϵͳ²ÎÊýÅжÏWISEÓû§ÊÇ·ñÓаó¶¨
///
///
///
///
///
public bool CheckModRight(string ModRightName, string sUserName, ref string sErrMsg)
{
try
{
//»ñȡϵͳ²ÎÊý
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
if (oSystemParameter.ShowBill(ref sErrMsg) == false)
{
sErrMsg = "»ñȡϵͳ²ÎÊýʧ°Ü£¡ " + sErrMsg;
return false;
}
//ÅжÏȨÏÞ
if (!DBUtility.ClsPub.Security_Log(ModRightName, 1, false, sUserName))
{
sErrMsg = "ÄúûÓÐȨÏÞ,ÇëÓë¹ÜÀíÔ±ÁªÏµ£¡";
return false;
}
//
if (oSystemParameter.omodel.Kf_MateOutBill_ERPMode.ToUpper() == "WISE") //ÅжÏͬ²½Ä£Ê½ÊǽðµûWISE
{
//ÅжÏÓû§ÊÇ·ñ°ó¶¨½ðµûÕ˺Å
DataSet ds;
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
ds = oCN.RunProcReturn("exec h_p_K3_User '" + sUserName + "'", "K3_User");
if (ds == null || ds.Tables[0].Rows.Count == 0)
{
sErrMsg = "ÄúµÄÓû§Ã»Óа󶨽ðµûÕ˺Å,ÇëÓë¹ÜÀíÔ±ÁªÏµ£¡";
return false;
}
}
return true;
}
catch (Exception e)
{
sErrMsg = "ȨÏÞÅжÏʧ°Ü£¡" + e.Message;
return false;
}
}
///
/// ¸ù¾ÝÓû§ÃûºÍÊäÈëµÄÃÜÂ룬ÑéÖ¤µÇ¼ÊÇ·ñÔÊÐí
///
///
///
///
public DataSet get_User(string sUserName, string sUserPsd, ref string sErrMsg)
{
try
{
DAL.ClsUser oUser = new DAL.ClsUser();
return oUser.CheckMainID(sUserName, DBUtility.ClsPub.StrToPsd(sUserPsd));
}
catch (Exception e)
{
sErrMsg = "Óû§ÅжÏʧ°Ü£¡" + e.Message;
return null;
}
}
}
}