コード例 #1
0
ファイル: UserLog.cs プロジェクト: iMutex/EBusiness
 private static void Log(string Ticks, string UserId, string ActionId, string ActionDetails)
 {
     DataAccessManager dam = new DataAccessManager();
     string[,] paramArray = { {"@Ticks", Ticks},
                            {"@UserId", UserId},
                            {"@ActionId", ActionId},
                            {"@ActionDetails", ActionDetails}};
     dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUserLog", paramArray);
 }
コード例 #2
0
ファイル: Order.cs プロジェクト: iMutex/EBusiness
 //New Method for Delete Order on OrderId
 public int DeleteOrder(int OrderID, int Operation)
 {
     int Result=0;
     //Operation=2;
         DataAccessManager dam= new DataAccessManager();
         string[,] paraArray =
     {
     {"@OrderId",OrderID.ToString()},
     {"@Operation",Operation.ToString()}
     };
         Result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteOrder", paraArray);
         return Result;
 }
コード例 #3
0
ファイル: Shop.cs プロジェクト: iMutex/EBusiness
        public bool InsertNewShop(string Operation, string ShopName, string ShopSologon, string Registration,
                                  string Address, string PhoneNumber, string Properiter, string SaleNote)
        {
            bool result = false;
                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                {"@Operation", Operation},
                {"@ShopName", ShopName},
                {"@ShopAddress", Address},
                {"@ShopNumber", PhoneNumber},
                {"@ShopSlogon", ShopSologon},
                {"@RegistrationNumber", Registration},
                {"@Properiter", Properiter},
                {"@SaleNote", SaleNote}

               };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteShop", paramArray) > 0;
                return result;
        }
コード例 #4
0
ファイル: ItemType.cs プロジェクト: iMutex/EBusiness
        public bool InsertUpdateItemType(string Id, string Name, string IsActive)
        {
            bool result = false;

                int operation = 0;
                int.TryParse(Id, out operation);

                if (operation > 0)
                    operation = 1;
                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                {"@Operation", operation.ToString()},
                {"@ItemTypeId", Id},
                {"@ItemTypeName", Name},
                {"@IsActive", IsActive}
               };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteItemType", paramArray) > 0;
            return result;
        }
コード例 #5
0
ファイル: SystemUser.cs プロジェクト: iMutex/EBusiness
        public static bool CreateUpdateUser(string UserName
           , string Password, string Name, string ContactNumber, string Address, string IsActive
           , string AllowInvoice, string AllowStock, string AllowCompany, string AllowCustomer
           , string AllowItem, string AllowShop, string AllowReports, string AllowUserManagement,
            string AllowOrder, string AllowCompanyPayment, string AllowCustomerPayment,
            string AllowReturnSale, string AllowReturnPurchase, int Opertion)
        {
            bool result = false;
            try
            {

                DataAccessManager dam = new DataAccessManager();
                string[,] pararray = {{"@UserName",UserName},
                                     {"@Password",Password},
                                     {"@Name",Name},
                                     {"@ContactNumber",ContactNumber},
                                     {"@Address",Address},
                                     {"@IsActive",IsActive},
                                     {"@AllowInvoice",AllowInvoice},
                                     {"@AllowStock",AllowStock},
                                     {"@AllowCompany",AllowCompany},
                                     {"@AllowCustomer",AllowCustomer},
                                     {"@AllowItem",AllowItem},
                                     {"@AllowShop",AllowShop},
                                     {"@AllowReports",AllowReports},
                                     {"@AllowUserManagement",AllowUserManagement},
                                     {"@AllowOrder",AllowOrder},
                                     {"@AllowCompanyPayment",AllowCompanyPayment},
                                     {"@AllowCustomerPayment",AllowCustomerPayment},
                                     {"@AllowReturnSale",AllowReturnSale},
                                     {"@AllowReturnPurchase",AllowReturnPurchase},
                                     {"@Id",Opertion.ToString()}
                                 };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteUser", pararray) > 0;
            }
            catch (Exception exe)
            {

                throw exe;
            }

            return result;
        }
コード例 #6
0
ファイル: SystemUser.cs プロジェクト: iMutex/EBusiness
        public static bool ChangePassword(string UserName, string Password, string NewPassword, int Operation)
        {
            try
            {
                bool result = false;
                DataAccessManager dam = new DataAccessManager();
                string[,] pararry = {{"@UserName",UserName},
                                {"@Password",Password},
                                {"@NewPassword",NewPassword},
                                {"@Operation",Operation.ToString()}
                                };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "ChangePassword", pararry) > 0;
                return result;
            }
            catch (Exception exe)
            {

                throw exe;
            }
        }
コード例 #7
0
ファイル: Customer.cs プロジェクト: iMutex/EBusiness
        public bool InsertUpdateCustomer(string Id, string code, string name, string contact, string address, string balance, string IsActive,
            string Remarks, string City, string ContactPerson, string Phone, string Fax, string Web, string Email)
        {
            bool result = false;
            try
            {
                //@Remarks ,@City ,@ContactPerson ,@Phone ,@Fax ,@Web ,@Email
                int operation = 0;
                int.TryParse(Id, out operation);

                if (operation > 0)
                    operation = 1;
                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                {"@Operation", operation.ToString()},
                {"@CustomerId", Id},
                {"@CustomerCode", code},
                {"@CustomerName", name},
                {"@ContactNumber", contact},
                {"@Address", address},
                {"@CustomerBalance", balance},
                {"@Remarks", Remarks},
                {"@City", City},
                {"@ContactPerson", ContactPerson},
                {"@Phone", Phone},
                {"@Fax", Fax},
                {"@Web", Web},
                {"@Email", Email},
                {"@IsActive", IsActive}
               };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteCustomer", paramArray) > 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }
コード例 #8
0
ファイル: ExceptionLog.cs プロジェクト: iMutex/EBusiness
        public static void LogException(Modules Module, string Method, Exception excp,string title)
        {
            try
            {
                if (excp != null)
                {
                    string Message = excp.Message;
                    string StackTrace = excp.StackTrace;
                    string InnerMessage = null;
                    if (excp.InnerException != null)
                    {
                        InnerMessage = excp.InnerException.Message;
                    }

                    bool result = false;

                    DataAccessManager dam = new DataAccessManager();
                    string[,] paramArray = {
                        {"@Module", Module.ToString()},
                        {"@Method", Method},
                        {"@Message", Message},
                        {"@StackTrace", StackTrace},
                        {"@InnerMessage", InnerMessage}

                        };
                    dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertExceptionLog", paramArray);

                    ExceptionMessageShow exception1 = new ExceptionMessageShow(title,Message);
                    exception1.ShowExceptionMessage();
                }
            }
            catch (Exception ex)
            {
                ExceptionMessageShow exception1 = new ExceptionMessageShow(title,ex.Message.ToString());
                exception1.ShowExceptionMessage();
            }
        }
コード例 #9
0
ファイル: Item.cs プロジェクト: iMutex/EBusiness
        public bool InsertUpdateItem(string Id, string ItemCode, string ItemName, string itemType, string packing, string CompanyId, string ItemInStock,
             string PurchasePrice, string SalePrice, string Discount, string IsActive,string BatchNo,DateTime ExpiryDate)
        {
            bool result = false;
            try
            {
                int operation = 0;
                int.TryParse(Id, out operation);

                if (operation > 0)
                    operation = 1;

                DataAccessManager dam = new DataAccessManager();        //object of DataManager class
                string[,] paramArray = {
                {"@Operation", operation.ToString()},
                {"@ItemId", Id},
                {"@ItemCode", ItemCode},
                {"@ItemName", ItemName},
                {"@ItemType", itemType},
                {"@Packing", packing},
                {"@CompanyId",CompanyId},
                {"@ItemInStock", ItemInStock},
                {"@PurchasePrice", PurchasePrice},
                {"@SalePrice", SalePrice},
                {"@Discount", Discount},
                {"@IsActive", IsActive},
                {"@ExpiryDate",Common.FormateDateForDB(ExpiryDate)},
                {"@BatchNo",BatchNo}
               };
                result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteItem", paramArray) > 0;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return result;
        }
コード例 #10
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
 public static void UpdateLR()
 {
     DataAccessManager dam = new DataAccessManager();
     dam.ExecuteNonQuery(CommandType.Text, string.Format("UPDATE Shop  SET [A34C0CEC63EC0F1739FB5CB8F43A9CE1]='{0}'", Encrypt(DateTime.Now.ToString(), pass)));
 }
コード例 #11
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
 public static void InitializeDatabase()
 {
     DataAccessManager dam = new DataAccessManager();
     dam.ExecuteNonQuery(CommandType.StoredProcedure, "Admin_InitializeDatabase");
 }
コード例 #12
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
 public static bool UnRegister()
 {
     bool result = false;
     DataAccessManager dam = new DataAccessManager();
     string[,] paramArray = {
                                {"@P1", null },
                                {"@P2", null},
                                {"@P3", null},
                                {"@P4", null}
                                };
     result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "Test", paramArray) > 0;
     return result;
 }
コード例 #13
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
        public static bool CreateRegistration(DateTime expiryDate)
        {
            string p1 = CreateUniqueKey();
            string p2 = Encrypt(DateTime.Now.ToString("MM-dd-yyyy"), pass);
            string p3 = Encrypt(expiryDate.ToString("MM-dd-yyyy"), pass);
            string p4 = Encrypt(DateTime.Now.ToString(), pass);

            bool result = false;
            DataAccessManager dam = new DataAccessManager();
            string[,] paramArray = {
                                       {"@P1", p1 },
                                       {"@P2", p2},
                                       {"@P3", p3},
                                       {"@P4", p4}
                                       };
            result = dam.ExecuteNonQuery(CommandType.StoredProcedure, "Test", paramArray) > 0;
            return result;
        }
コード例 #14
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
 public static int ExecuteUpdateDeleteQuery(string query)
 {
     int count = 0;
     try
     {
         DataAccessManager dam = new DataAccessManager();
         count = dam.ExecuteNonQuery(CommandType.Text, query);
     }
     catch (Exception ex)
     {
         throw;
     }
     return count;
 }
コード例 #15
0
ファイル: Common.cs プロジェクト: iMutex/EBusiness
 public static void CreateBackup(string filePath)
 {
     DataAccessManager dam = new DataAccessManager();
     string[,] paramArray = { { "@FilePath", filePath } };
     dam.ExecuteNonQuery(CommandType.StoredProcedure, "Admin_CreateBackup", paramArray);
 }
コード例 #16
0
ファイル: Item.cs プロジェクト: iMutex/EBusiness
        private int SaveReceiptDetail(
            string ReceiptId,
            string ItemId,
            string SalePrice,
            string Quantity,
            string GrandTotal,
            string Discount,
            string Total,
            string ItemDiscount,
            bool IsReturn,
            string PrevReceiptId )
        {
            int count = 0;
            try
            {
                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                                       {"@ReceiptId", ReceiptId },
                                       {"@ItemId", ItemId },
                                       {"@SalePrice", string.IsNullOrEmpty(SalePrice)?"0":SalePrice },
                                       {"@Quantity", string.IsNullOrEmpty(Quantity)?"0":Quantity },
                                       {"@GrandTotal", string.IsNullOrEmpty(GrandTotal)?"0":GrandTotal },
                                       {"@Discount", string.IsNullOrEmpty(Discount)?"0":Discount },
                                       {"@Total", string.IsNullOrEmpty(Total)?"0":Total },
                                       {"@ItemDiscount", string.IsNullOrEmpty(ItemDiscount)?"0":ItemDiscount },
                                       {"@IsReturn", IsReturn?"1":"0"},
                                       {"@PrevReceiptId", PrevReceiptId}
                                       };
                count = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteReceiptDetail", paramArray);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return count;
        }
コード例 #17
0
ファイル: Order.cs プロジェクト: iMutex/EBusiness
        private int SaveOrderDetail(string OrderId, string ItemId, string PurchasePrice, string Quantity, string Total, string Discount, string GrandTotal)
        {
            int count = 0;
            try
            {
                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                                       {"@OrderId", OrderId },
                                       {"@ItemId", ItemId },
                                       {"@PurchasePrice", PurchasePrice },
                                       {"@Quantity", Quantity },
                                       {"@Total", Total },
                                       {"@Discount", Discount},
                                       {"@GrandTotal", GrandTotal}
                                       };
                count = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteOrderDetail", paramArray);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return count;
        }
コード例 #18
0
ファイル: Item.cs プロジェクト: iMutex/EBusiness
        private void SetReceiptProfitLoss(long ReceiptId)
        {
            try
            {
                DataAccessManager dam = new DataAccessManager();
                dam.ExecuteNonQuery(CommandType.Text, "exec SetReceiptProfitLoss " + ReceiptId.ToString());
            }
            catch (Exception exe)
            {

                throw exe;
            }
        }
コード例 #19
0
ファイル: Item.cs プロジェクト: iMutex/EBusiness
        private int SaveInvoiceDetail(string InvoiceId, string ItemId, string PurchasePrice, string Quantity, string Total, string Discount, string GrandTotal, bool IsReturn)
        {
            int count = 0;

                DataAccessManager dam = new DataAccessManager();
                string[,] paramArray = {
                                       {"@InvoiceId", InvoiceId },
                                       {"@ItemId", ItemId },
                                       {"@PurchasePrice", string.IsNullOrEmpty(PurchasePrice)?"0":PurchasePrice },
                                       {"@Quantity", string.IsNullOrEmpty(Quantity)?"0":Quantity },
                                       {"@Total", string.IsNullOrEmpty(Total)?"0":Total },
                                       {"@Discount", string.IsNullOrEmpty(Discount)?"0":Discount},
                                       {"@GrandTotal", string.IsNullOrEmpty(GrandTotal)?"0":GrandTotal},
                                       {"@IsReturn", IsReturn?"1":"0"}
                                       };
                count = dam.ExecuteNonQuery(CommandType.StoredProcedure, "InsertUpdateDeleteInvoiceDetail", paramArray);
            //}

            return count;
        }