示例#1
0
        public int DeleteIndentDetails(MedicineIndent aMedicineIndent)
        {
            int count = 0;

            if (aMedicineIndent.DrugsDatatable != null)
            {
                Query               = "Delete MedicineIndentDetails where IndentNo= @IndentNo";
                Command             = new SqlCommand(Query, Connection);
                Command.CommandType = CommandType.Text;
                Command.Parameters.AddWithValue(@"IndentNo", aMedicineIndent.IndentNo);
                count += Command.ExecuteNonQuery();
            }
            return(count);
        }
示例#2
0
        public int UpdateMedicineIndent(MedicineIndent aMedicineIndent)
        {
            int rowAffect = 0;

            Query   = "Update MedicineIndentPrimary set Date = @Date,PatientType = @PatientType,PatientID=@PatientID where IndentNo= @IndentNo ";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("@IndentNo", aMedicineIndent.IndentNo ?? "");
            Command.Parameters.AddWithValue("@Date", aMedicineIndent.Date);
            Command.Parameters.AddWithValue("@PatientType", aMedicineIndent.PatientType ?? "");
            Command.Parameters.AddWithValue("@PatientID", aMedicineIndent.PatientId ?? "");
            rowAffect = Command.ExecuteNonQuery();

            return(rowAffect);
        }
示例#3
0
        public int SaveMedicineIndent(MedicineIndent aMedicineIndent)
        {
            int rowAffect = 0;

            Query = "INSERT INTO MedicineIndentPrimary(IndentNo,Date,PatientType,PatientID)" +
                    "VALUES(@IndentNo,@Date,@PatientType,@PatientID)";
            Command = new SqlCommand(Query, Connection);
            Command.Parameters.AddWithValue("@IndentNo", aMedicineIndent.IndentNo ?? "");
            Command.Parameters.AddWithValue("@Date", aMedicineIndent.Date);
            Command.Parameters.AddWithValue("@PatientType", aMedicineIndent.PatientType ?? "");
            Command.Parameters.AddWithValue("@PatientID", aMedicineIndent.PatientId ?? "");
            rowAffect = Command.ExecuteNonQuery();

            return(rowAffect);
        }
        public MessageModel SaveMedicineIndent(MedicineIndent aMedicineIndent)
        {
            int          rowAffect     = 0;
            int          rowAffect2    = 0;
            MessageModel aMessageModel = new MessageModel();

            rowAffect = new MedicineIndentGateway().SaveMedicineIndent(aMedicineIndent);
            if (rowAffect > 0)
            {
                rowAffect2 = new MedicineIndentGateway().SaveMedicineIndentDetails(aMedicineIndent);
            }
            if (rowAffect2 > 0)
            {
                aMessageModel.MessageTitle = "Successfull";
                aMessageModel.MessageBody  = "Saved Successfully.";
            }
            return(aMessageModel);
        }
示例#5
0
        public int SaveMedicineIndentDetails(MedicineIndent aMedicineIndent)
        {
            int count = 0;

            if (aMedicineIndent.DrugsDatatable != null)
            {
                foreach (DataRow value in aMedicineIndent.DrugsDatatable.Rows)
                {
                    Query               = "INSERT INTO MedicineIndentDetails(IndentNo,ProductCode,ProductQty)VALUES (@IndentNo,@ProductCode,@ProductQty)";
                    Command             = new SqlCommand(Query, Connection);
                    Command.CommandType = CommandType.Text;
                    Command.Parameters.AddWithValue(@"IndentNo", aMedicineIndent.IndentNo);
                    Command.Parameters.AddWithValue(@"ProductCode", value["ProductCode"]);
                    Command.Parameters.AddWithValue(@"ProductQty", value["Qty"]);

                    count += Command.ExecuteNonQuery();
                }
            }
            return(count);
        }