Ejemplo n.º 1
0
        public bool InsertData_userDetail(ClsUserManageData UserData)
        {
            bool   ret = false;
            string insertToUserDetail = string.Empty;
            string insertToLogin      = string.Empty;

            try
            {
                //create querry for tbl_userdetail
                insertToUserDetail  = "INSERT INTO tbl_userdetail ( userId, userName, firstName, lastName, dob, NIC, address, email, roleId, phoneNo ) VALUES ( ";
                insertToUserDetail += "'" + UserData._userId + "',";
                insertToUserDetail += "'" + UserData._userName + "',";
                insertToUserDetail += "'" + UserData._firstName + "',";
                insertToUserDetail += "'" + UserData._lastName + "',";
                insertToUserDetail += "'" + UserData._dob + "',";
                insertToUserDetail += "'" + UserData._idNumber + "',";
                insertToUserDetail += "'" + UserData._address + "',";
                insertToUserDetail += "'" + UserData._email + "',";
                insertToUserDetail += "'" + UserData._roleId + "',";
                insertToUserDetail += "'" + UserData._phoneNo;
                insertToUserDetail += "');";

                //create querry for tbl_login
                insertToLogin  = "******";
                insertToLogin += "'" + UserData._userName + "',";
                insertToLogin += "'" + COMMON.EncodePassword(UserData._userName) + "',";
                insertToLogin += "'" + UserData._userId + "',";
                insertToLogin += "'" + UserData._roleId;
                insertToLogin += "');";

                if (CONN.update(insertToUserDetail))
                {
                    if (CONN.update(insertToLogin))
                    {
                        ret = true;
                    }
                }
            }
            catch (Exception e)
            {
                ret = false;
                throw e;
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public bool insertData_stockEntry(ClsStockData stockData)
        {
            bool   isError = false;
            string querry  = string.Empty;

            try
            {
                querry += @"INSERT INTO tbl_stockentry 
                            (stockEntryId, itemCode, itemId, updateDate, quantity, 
                            buyingUnitPrice, sellingUnitPrice, stockEntryDate, 
                            createDate, expirationDate, totalValue, 
                            remainQuantity, priceAfterDiscount, comment, dealerId, stockUnitId) 
                            VALUES (";
                querry += "'" + stockData._stockEntryId + "',";
                querry += "'" + stockData._itemCode + "',";
                querry += "'" + stockData._itemId + "',";
                querry += "'" + stockData._updateDate + "',";
                querry += "'" + stockData._quantity + "',";
                querry += "'" + stockData._buyUnitPrice + "',";
                querry += "'" + stockData._sellUnitPrice + "',";
                querry += "'" + stockData._stockEntryDate + "',";
                querry += "'" + stockData._createDate + "',";
                querry += "'" + stockData._expireDate + "',";
                querry += "'" + stockData._totalValue + "',";
                querry += "'" + stockData._remainQuantity + "',";
                querry += "'" + stockData._priceAfterDiscount + "',";
                querry += "'" + stockData._comment + "',";
                querry += "'" + stockData._dealerId + "',";
                querry += "'" + stockData._stockUnitId + "'";
                querry += ");";

                isError = CONN.update(querry);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(isError);
        }
Ejemplo n.º 3
0
        public bool deleteItem(int itemId)
        {
            bool   ret = false;
            string q   = string.Empty;

            try
            {
                q   = "UPDATE tbl_item SET deleteFlg = '1' WHERE itemId = '" + itemId + "';";
                ret = CONN.update(q);
                ret = true;
            }
            catch (Exception ex)
            {
                ret = false;
                throw ex;
            }
            return(ret);
        }