public static bool Update(ConfigItem p_configItem, DataRow p_dtRow) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { object[] arrValue = new object[] { p_dtRow["Id"], p_dtRow["Unit_In_Pk"], p_dtRow["Unit_Out_Pk"], p_dtRow["Remark"], p_dtRow["Num"] }; string[] arrParaName = new string[] { "@Id", "@Unit_In_Pk", "@Unit_Out_Pk", "@Remark", "@Num" }; _sql.Connect(p_configItem); _sql.ExecuteNonQuery("USP_UPD_UNIT_STYLE", arrParaName, arrValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static int Insert(ConfigItem p_ConfigItem, object[] parramValue) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Name", "@Phone", "@Address", "@Fax", "@Email", "@Website", "@Crt_By", "@TaxCode", "@Credit", "@Debit" }; _sql.Connect(p_ConfigItem); return(_sql.ExecuteInsert("USP_INS_SUPPLIER", arrParaName, parramValue)); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static bool Update(ConfigItem p_ConfigItem, object[] parramValue) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id", "@Name", "@Phone", "@Address", "@Fax", "@Email", "@Website", "@Mod_By", "@TaxCode", "@Credit", "@Debit" }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_UPD_SUPPLIER", arrNames: arrParaName, arrValues: parramValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static bool Update(ConfigItem p_ConfigItem, object[] arrValue) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id", "@Name_Dis", "@Name", "@Password", "@Mod_By", "@Remark", "@Phone", "@Address", "@Department_Pk" }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_UPD_USER", arrNames: arrParaName, arrValues: arrValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static int Insert(ConfigItem p_ConfigItem, object[] arrValue) { int ma = 0; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Name_Dis", "@Name", "@Password", "@Crt_By", "@Remark", "@Phone", "@Address", "@Department_Pk" }; _sql.Connect(p_ConfigItem); ma = _sql.ExecuteInsert("USP_INS_USER", arrNames: arrParaName, arrValues: arrValue); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(ma); }
public static bool Update(ConfigItem p_ConfigItem, object[] arrValue) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id", "@Name", "@Crt_Dt", "@Crt_By", "@Remark" }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_UPD_UNIT", arrParaName, arrValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static bool Update(ConfigItem p_ConfigItem, Supplier p_Supplier) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id", "@Name", "@Phone", "@Phone1", "@Address", "@Address1", "@Fax", "@Email", "@Website", "@Mod_By", "@TaxCode", "@Credit", "@Debit" }; object[] arrParaValue = new object[] { p_Supplier.Id, p_Supplier.Name, p_Supplier.Phone, p_Supplier.Phone1, p_Supplier.Address, p_Supplier.Address1, p_Supplier.Fax, p_Supplier.Email, p_Supplier.Website, p_ConfigItem.Login_UserName, p_Supplier.TaxCode, p_Supplier.Credit, p_Supplier.Debit }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_UPD_SUPPLIER", arrNames: arrParaName, arrValues: arrParaValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static DataTable GetList(ConfigItem p_ConfigItem) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { _sql.Connect(p_ConfigItem); return(_sql.GetDataByStoredProcedure("USP_SEL_GROUP_All")); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static DataTable GetList_1(ConfigItem p_configItem) { COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { l_sql.Connect(); return(l_sql.GetDataByStoredProcedure("USP_SEL_UNIT_STYLE_1")); } catch (Exception ex) { throw ex; } finally { l_sql.Disconnect(); } }
public static DataTable GetList(ConfigItem p_ConfigItem, int p_Catalog_Pk) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id" }; object[] arrValue = new object[] { p_Catalog_Pk }; _sql.Connect(p_ConfigItem); return(_sql.GetDataByStoredProcedure("USP_SEL_CATALOG_BY_ID", arrParaName, arrValue)); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static int Update(ConfigItem p_configItem, DataRow p_drGroup) { COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { string[] l_arrName = new string[] { "@Id", "@Name", "@Mod_By", "@Remark", "@ID_Cat" }; object[] l_arrValue = new object[] { p_drGroup["Id"], p_drGroup["Name"], p_configItem.Login_UserName, p_drGroup["Remark"], p_drGroup["Id_Cat"] }; l_sql.Connect(p_configItem); return(l_sql.ExecuteNonQuery("USP_UPD_GROUP", l_arrName, l_arrValue)); } catch (Exception ex) { throw ex; } finally { l_sql.Disconnect(); } }
public static int Delete(ConfigItem p_configItem, int p_Group_Pk) { COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { string[] l_arrName = new string[] { "@Id" }; object[] l_arrValue = new object[] { p_Group_Pk }; l_sql.Connect(p_configItem); return(l_sql.ExecuteNonQuery("USP_DEL_GROUP", l_arrName, l_arrValue)); } catch (Exception ex) { throw ex; } finally { l_sql.Disconnect(); } }
public static DataTable GetList_1(ConfigItem p_configItem, int p_Unit_Out_Pk) { COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { l_sql.Connect(); string[] l_arrName = new string[] { "@Unit_Out_Pk" }; object[] l_arrValue = new object[] { p_Unit_Out_Pk }; return(l_sql.GetDataByStoredProcedure("USP_SEL_UNIT_STYLE_1", l_arrName, l_arrValue)); } catch (Exception ex) { throw ex; } finally { l_sql.Disconnect(); } }
public static DataTable GetList(ConfigItem p_configItem, int p_GroupID) { COREBASE.COMMAND.SQL.AccessSQL l_sql = new COREBASE.COMMAND.SQL.AccessSQL(p_configItem); try { l_sql.Connect(); string[] l_arrName = new string[] { "@Group_Pk" }; object[] l_arrValue = new object[] { p_GroupID }; return(l_sql.GetDataByStoredProcedure("USP_SEL_ITEM_BY_GROUP_ID", l_arrName, l_arrValue)); } catch (Exception ex) { throw ex; } finally { l_sql.Disconnect(); } }
public static DataSet GetListTakeOut(int p_Take_Out_Pk, ConfigItem p_ConfigItem) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { _sql.Connect(p_ConfigItem); string[] arrParaName = new string[] { "@Take_Out_Pk" }; object[] arrParaValue = new object[] { p_Take_Out_Pk }; return(_sql.GetDataByStoredProcedure_DS("USP_RPT_TAKE_OUT", arrParaName, arrParaValue)); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static DataTable GetListTable(ConfigItem p_ConfigItem) { DataTable dt; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { _sql.Connect(p_ConfigItem); dt = _sql.GetDataByStoredProcedure("USP_SEL_SUPPLIER"); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(dt); }
public static bool Delete(ConfigItem p_ConfigItem, int _idSuppiler) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Id" }; object[] arrParaValue = new object[] { _idSuppiler }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_DEL_SUPPLIER", arrParaName, arrParaValue); return(true); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static IList <Supplier> GetList(ConfigItem p_ConfigItem) { IList <Supplier> lUser = null; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { _sql.Connect(p_ConfigItem); DataTable dt = _sql.GetDataByStoredProcedure("USP_SEL_SUPPLIER"); lUser = COREBASE.COMMAND.SQL.CMapping.MapList <Supplier>(dt); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(lUser); }
public DataSet GetData(int type) { DataSet ds = null; string store = "USP_RPT_NHAPKHO"; if (type == 1) { store = "USP_RPT_XUATKHO"; } else if (type == 0) { store = "USP_RPT_NHAPKHO"; } else if (type == 2) { store = "USP_RPT_PB_HH"; } else { store = "USP_RPT_XUAT_PB"; } COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(_ConfigItem); try { string[] arrParaName = new string[] { "@Item_Id", "@From", "@To" }; object[] arrValue = new object[] { 79, dateFrom.EditValue, dateTo.EditValue }; _sql.Connect(_ConfigItem); ds = _sql.GetDataByStoredProcedure_DS(store, arrParaName, arrValue); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(ds); }
public static DataTable GetListRoleByUID(ConfigItem p_ConfigItem, object[] arrValue) { DataTable dt = null; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@UserId" }; _sql.Connect(p_ConfigItem); dt = _sql.GetDataByStoredProcedure("USP_SEL_USER_ROLE_ByUser", arrParaName, arrValue); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(dt); }
public static void Restore(ConfigItem p_ConfigItem, string file) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Path" }; string[] arrParaValue = new string[] { file }; _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("[USP_SYS_Restore]", arrParaName, arrParaValue); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public static int Insert(ConfigItem p_ConfigItem, object[] arrValue) { COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); try { string[] arrParaName = new string[] { "@Name", "@Crt_Dt", "@Crt_By", "@Remark" }; _sql.Connect(p_ConfigItem); return(_sql.ExecuteInsert("USP_INS_UNIT", arrNames: arrParaName, arrValues: arrValue)); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } }
public DataSet GetDataDetail() { DataSet ds = null; string store = "USP_RptTonKhoDetail"; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(_ConfigItem); try { string[] arrParaName = new string[] { "@fromMonth", "@toMonth" }; object[] arrValue = new object[] { dateFrom.EditValue, dateTo.EditValue }; _sql.Connect(_ConfigItem); ds = _sql.GetDataByStoredProcedure_DS(store, arrParaName, arrValue); } catch (Exception ex) { throw ex; } finally { _sql.Disconnect(); } return(ds); }
public static bool DeleteDetail(ConfigItem p_ConfigItem, DataRow p_drValue) { bool l_rs = false; COREBASE.COMMAND.SQL.AccessSQL _sql = new COREBASE.COMMAND.SQL.AccessSQL(p_ConfigItem); string[] arrParaName = new string[] { "@Id", "@Crt_By" }; object[] arrParaValue = new object[] { p_drValue["Id"], p_ConfigItem.Login_ID }; try { _sql.Connect(p_ConfigItem); _sql.ExecuteNonQuery("USP_DEL_TAKE_OUT_DETAIL", arrParaName, arrParaValue); l_rs = true; } catch (Exception ex) { l_rs = false; throw ex; } finally { _sql.Disconnect(); } return(l_rs); }