Esempio n. 1
0
        protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxComboBox NaturalPerson = ASPxGridView2.FindEditFormLayoutItemTemplateControl("PersonnePysique") as ASPxComboBox;

            cn.Open();
            string        req = "select Id from NaturalPerson where FirstName= '" + NaturalPerson.SelectedItem.ToString() + "'";
            SqlCommand    cmd = new SqlCommand(req, cn);
            SqlDataReader dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                e.NewValues["PersonnePysique_Id"] = dr["Id"].ToString();
            }
            cn.Close();

            ASPxComboBox Adresse = ASPxGridView2.FindEditFormLayoutItemTemplateControl("PartnerDocs") as ASPxComboBox;

            cn.Open();
            string        req1 = "select Id from PartnerDocs where DocRef= '" + Adresse.SelectedItem.ToString() + "'";
            SqlCommand    cmd1 = new SqlCommand(req1, cn);
            SqlDataReader dr1  = cmd1.ExecuteReader();

            while (dr1.Read())
            {
                e.NewValues["PartnerDocs_Id"] = dr1["Id"].ToString();
            }
            cn.Close();
        }
Esempio n. 2
0
        protected void ASPxGridView2_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
        {
            ASPxComboBox Good = ASPxGridView2.FindEditFormLayoutItemTemplateControl("Good") as ASPxComboBox;

            cn.Open();
            string        req = "select Id from Good where TypeCode= '" + Good.SelectedItem.ToString() + "'";
            SqlCommand    cmd = new SqlCommand(req, cn);
            SqlDataReader dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                e.NewValues["Id_Good"] = dr["Id"].ToString();
            }
            cn.Close();

            ASPxComboBox Adresse = ASPxGridView2.FindEditFormLayoutItemTemplateControl("PartnerDocs") as ASPxComboBox;

            cn.Open();
            string        req1 = "select Id from PartnerDocs where DocRef= '" + Adresse.SelectedItem.ToString() + "'";
            SqlCommand    cmd1 = new SqlCommand(req1, cn);
            SqlDataReader dr1  = cmd1.ExecuteReader();

            while (dr1.Read())
            {
                e.NewValues["PartnerDocs_Id"] = dr1["Id"].ToString();
            }
            cn.Close();
        }
Esempio n. 3
0
        protected void ASPxGridView2_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            ASPxComboBox code = ASPxGridView2.FindEditFormLayoutItemTemplateControl("Code") as ASPxComboBox;

            cn.Open();
            string        req = "select Id from IdentityDocType where Code= '" + code.SelectedItem.ToString() + "'";
            SqlCommand    cmd = new SqlCommand(req, cn);
            SqlDataReader dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                e.NewValues["IdentityDocType_Id"] = dr["Id"].ToString();
            }
            cn.Close();

            e.NewValues["DocScan"] = Session["data"];
        }